﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using LuaInterface;
using CoreDC;

namespace CoreDC.ScriptEngine
{
    class Program
    {
        static void Main(string[] args)
        {
            //var program = new Program();

            //var lua = new Lua();

            //lua["num"] = 2;
            //lua["str"] = "a string";
            
            //double num = (double)lua["num"];
            //string str = (string)lua["str"];
            
            //Console.WriteLine("str:" + str + "\tnum:" + num);
            //Console.ReadLine();
            
            ////Register our C# functions
            //lua.RegisterFunction("DanSays", program, program.GetType().GetMethod("DanSays"));
            //lua.RegisterFunction("ThorSays", program, program.GetType().GetMethod("ThorSays"));


            //lua.DoString("DanSays('Hello'); ThorSays('Hi! Dan')");
            //Console.ReadLine();



            //Person pete = new Person();
            //Person jeff = new Person();
            //pete.talk("Hello");
            //jeff.talk("Hello");

           var program = new Program();
           var lua = new Lua();
           
           //Register our C# functions
           lua.RegisterFunction("DanSays", program, program.GetType().GetMethod("DanSays"));
           lua.RegisterFunction("ThorSays", program, program.GetType().GetMethod("ThorSays"));
           
           
           lua.DoFile("scripts/Thursdays.txt");
           Console.ReadLine(); 
        }

        public void DanSays(string s)
        {
            Console.WriteLine("Dan > " + s);
        }

        public void ThorSays(string s)
        {
            Console.WriteLine("Thor > " + s);
        }
    }
}
